<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let a;
        let b,c,d;
        let e = 100;
        let f = 521,g = 'iloveyou',h = [];

        //1 变量名不能重复声明
        // let star = "ArimaMisaki";
        // let star = "憨瓜";

        //2 var不受作用域限制，而let受作用域限制
        {
            let girl = "loving girl";
        }
        console.log(girl);
        
        //3 let变量没有声明前不得使用，语法靠近C、C++
        console.log(song);
        // var song = '爱你';
        let song = '爱你';

        //4 不影响作用域链，虽然let不在作用域中却能使用
        {
            let school = "CSDN学院";
            function fn() {
                console.log(school);
            }
            fn();
        }
    </script>
</body>
</html>